export default {
  createLine(num = 1){
    let next = this.mapSite.attr.next || [];
    // this.dialogs.showInfo('提示', '已经进入编辑模式，点击地图上的节点即可修改');
    this.htmlElement.querySelector('.tip').innerHTML = '已进入编辑模式，点击节点即可实现链接';
    
    this.useEditMode((mapClip, mapSite) => {
      if(mapSite.mapPos[0] == this.mapSite.mapPos[0] && 
        mapSite.mapPos[1] == this.mapSite.mapPos[1]) return;
      // console.log(mapSite);
      // 创建单/双向链接
      if(!this.isExistsNext(next, mapSite.mapPos)){
        next.push({
          pos: mapSite.mapPos
        });
      }

      if(num === 2){
        if(!this.isExistsNext(mapSite.attr.next, this.mapSite.mapPos)){
          mapSite.attr.next.push({
            pos: this.mapSite.mapPos
          })
        }
      }
  
      this.renderView(false);
      this.renderMapSitePanel();
    })
  }
}